public class MethodParameter03 {
    public static void main(String[] args) {
        Person3 p1 = new Person3();
        p1.name = "小明";
        p1.age = 18;
        MyTools tools = new MyTools();
        Person3 p2 = tools.copyPerson(p1);
        System.out.println("p1 的属性 age=" + p1.age + " 名字=" + p1.name);
        System.out.println("p2 的属性 age=" + p2.age + " 名字=" + p2.name);
    }
}

class Person3{
    String name;
    int age;
}

class MyTools{
    public Person3 copyPerson(Person3 p1){
        Person3 p2 = new Person3();
        p2.name =p1.name;
        p2.age = p1.age;
        return p2;
    }
}